import React from 'react';
import CommonList from '../../../components/CommonLists/list';
import { Button } from 'antd';
import Modal from '../../../components/Modal';
import Code from './Code'

class TacticsEventList extends CommonList {
  constructor(props) {
    super(props);
    this.api = 'operationLog';
    this.operatorWidth = 100;
    this.detailButton = record => {
      return (
        <Button
          size='small'
          type='link'
          onClick={this.detailOpen.bind(this, record)}
        >
          详情
        </Button>
      );
    };
    this.btnGroup = [this.detailButton];
  }
  componentDidMount() {}

  detailOpen = (record) => {
    Modal.open({
      title: '查看详情',
      width: '600px',
      content: (
        <Code
          record={record}
        />
      ),
      isOkBtn: true,
      isCancelBtn: false,
      ok: () => {
        Modal.close();
      },
    });
  }
}

export default TacticsEventList;
